<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('部门调动管理')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-employee-transferdept" th:object="${employee}">
        <input name="employeeId" th:field="*{employeeId}" type="hidden">
<!--        <div class="form-group">-->
<!--            <label class="col-sm-3 control-label is-required">员工姓名：</label>-->
<!--            <div class="col-sm-8">-->
<!--                <input name="employeeName" th:field="*{employeeName}" class="form-control" type="text" required>-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="form-group">-->
<!--            <label class="col-sm-3 control-label is-required">员工性别：</label>-->
<!--            <div class="col-sm-8">-->
<!--                <select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}" required>-->
<!--                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{sex}"></option>-->
<!--                </select>-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="form-group">-->
<!--            <label class="col-sm-3 control-label">员工年龄：</label>-->
<!--            <div class="col-sm-8">-->
<!--                <input name="age" th:field="*{age}" class="form-control" type="text">-->
<!--            </div>-->
<!--        </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">部门名称：</label>
            <div class="col-sm-8">
<!--                <input name="dept" th:field="*{dept}" class="form-control" type="text" required>-->
                <select id="dept" class="form-control select2-selection--single">
                    <option th:each="dept:${dept}" th:value="${dept.deptName}" th:text="${dept.deptName}" th:field="*{dept}" th:disabled="${dept.status == '1'}"></option>
                </select>
            </div>
        </div>
<!--        <div class="form-group">-->
<!--            <label class="col-sm-3 control-label is-required">员工岗位：</label>-->
<!--            <div class="col-sm-8">-->
<!--                <input name="post" th:field="*{post}" class="form-control" type="text" required>-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="form-group">-->
<!--            <label class="col-sm-3 control-label is-required">员工手机：</label>-->
<!--            <div class="col-sm-8">-->
<!--                <input name="phone" th:field="*{phone}" class="form-control" type="text" required>-->
<!--            </div>-->
<!--        </div>-->
    </form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "system/employee";
    $("#form-employee-transferdept").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
             var data = $('#form-employee-transferdept').serializeArray();
             var dept = $.form.selectSelects("dept");
            data.push({"name": "dept", "value": dept});
            $.operate.save(prefix + "/transferdept", data);
        }
    }
</script>
</body>
</html>